<template>
	<view class="container">
		<view class="list">
			<view class="top_box">
				<view class="title">遥阳科技</view>
				<view class="phone" @click="call"><u-icon name="phone" color="#fff" size="32"></u-icon></view>
			</view>
			<view class="bottom_box">
				<view class="address">重庆市重庆市渝中区中山路15号 三栋12-24</view>
				<view class="position" @click="openMap">
					距离<text>3.1</text>千米<u-icon name="map-fill" color="#EA3D37" size="32"></u-icon>
				</view>
			</view>
		</view>
		<view class="list">
			<view class="top_box">
				<view class="title">九爷精酿啤酒线下体验店（沙坪坝店）</view>
				<view class="phone"><u-icon name="phone" color="#fff" size="32"></u-icon></view>
			</view>
			<view class="bottom_box">
				<view class="address">重庆市重庆市沙坪坝区区中山路15号 三栋12-24</view>
				<view class="position" @click="openMap">
					距离<text>3.1</text>千米<u-icon name="map-fill" color="#EA3D37" size="32"></u-icon>
				</view>
			</view>
		</view>
		<view class="list">
			<view class="top_box">
				<view class="title">九爷精酿啤酒线下体验店（总店）</view>
				<view class="phone"><u-icon name="phone" color="#fff" size="32"></u-icon></view>
			</view>
			<view class="bottom_box">
				<view class="address">重庆市重庆市渝中区中山路15号 三栋12-24</view>
				<view class="position" @click="openMap">
					距离<text>3.1</text>千米<u-icon name="map-fill" color="#EA3D37" size="32"></u-icon>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {

			}
		},
		methods: {
			openMap() {
				console.log(123);
				uni.openLocation({
					latitude: 39.908692,
					longitude: 116.397477,
					success: function() {
						console.log('success');
					}
				});
			},
			call(){
				uni.makePhoneCall({
					phoneNumber: 17322222222, // 电话号码
					success: function() {
						console.log('拨号成功');
					},
					fail: function() {
						console.log('拨号失败');
					}
				});
			},
		}
	}
</script>

<style scoped lang="scss">
	.list {
		background: #fff;
		border-radius: 20rpx;
		padding: 30rpx;
		margin-bottom: 30rpx;

		.bottom_box {
			margin-top: 20rpx;
			display: flex;
			align-items: center;
			justify-content: space-between;

			.address {
				font-size: 24rpx;
				color: #999;
				width: 400rpx;
				text-overflow: ellipsis;
				white-space: w;
				overflow: hidden;
			}

			.position {
				font-size: 24rpx;

				.text {
					color: #EA3D37;
				}
			}
		}

		.top_box {
			display: flex;
			align-items: center;
			justify-content: space-between;

			.title {
				font-size: 30rpx;
				font-weight: bold;
				width: 400rpx;
			}

			.phone {
				width: 60rpx;
				height: 60rpx;
				background: #EA3D37;
				border-radius: 50%;
				display: flex;
				align-items: center;
				justify-content: center;
			}
		}
	}

	.container {
		background: #f1f2f3;
		min-height: 100vh;
		padding: 30rpx;
	}
</style>